home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Software Vault: The Gold Collection
/
Software Vault - The Gold Collection (American Databankers) (1993).ISO
/
cdr47
/
wasm223.zip
/
TODDY.DOC
< prev
next >
Wrap
Text File
|
1993-05-04
|
59KB
|
1,222 lines
Toddy
A DOS Command Line Editor
by
Eric Tauck
1304 Deerpass Road
Marengo, IL 60152
U.S.A
Compuserve: 72457,1557
Internet: 72457.1557@compuserve.com
Toddy is a terminate and stay resident (TSR) utility that eases
the entry and editing of DOS commands, saves commands for later
retrieval, and provides resident macros that work like simple
batch files. Only certain programs that use DOS for input, like
COMMAND.COM or DEBUG.COM, will be affected by Toddy. Toddy will
work on any PC compatible running DOS 2.0 or greater.
Toddy may be used and distributed freely. The most recent ver-
sion of the Toddy is available on 5.25" or 3.5" disk by sending
$10 to the address above. The WASM compatible source code is
available for $50. The source code is for personal use and may
not be distributed.
DISCLAIMER OF WARRANTY
THIS SOFTWARE AND MANUAL ARE DISTRIBUTED "AS IS" AND WITHOUT
WARRANTIES AS TO PERFORMANCE OF MERCHANTABILITY OR ANY OTHER
WARRANTIES WHETHER EXPRESSED OR IMPLIED. BECAUSE OF THE VARIOUS
HARDWARE AND SOFTWARE ENVIRONMENTS INTO WHICH THIS PROGRAM MAY BE
PUT, NO WARRANTY OF FITNESS FOR A PARTICULAR PURPOSE IS OFFERED.
GOOD DATA PROCESSING PROCEDURE DICTATES THAT ANY PROGRAM BE
THOROUGHLY TESTED WITH NON-CRITICAL DATA BEFORE RELYING ON IT.
THE USER MUST ASSUME THE ENTIRE RISK OF USING THE PROGRAM. ANY
LIABILITY OF THE SELLER WILL BE LIMITED EXCLUSIVELY TO PRODUCT
REPLACEMENT OR REFUND OF PURCHASE PRICE.
Installation
------------
Toddy is installed by running it from the command line. The
features of Toddy are available upon installation. Toddy is
usually installed from the AUTOEXEC.BAT file when the computer is
booted up. If you get the message "Multiplex number in use by
another program" when you try to install Toddy, see the /M switch
described in the Switch Descriptions section.
Toddy uses a minimum of 3696 bytes of memory, and 4512 bytes in
its default configuration. The memory consumption increases
according to the size of the command history (/HS) and macro data
areas (/MS and /MN). If you don't use the command history, you
can conserve memory by setting the history size to zero (/HS0).
If you don't use macros, you can conserve memory by setting the
macro table size, macro nest to zero, and the buffer size to 255
(/MS0, /MN0, and /B255 respectively). The total bytes used by
the /HS and /MS must be less than about 51000.
The appearance of Toddy (i.e. the colors and cursor types) can be
set with the /AC, /AE, /AT, /TC, /TE, /TI, /TO, /TS, and /TX
switches. By default, Toddy sets all the colors to white on
black and does not modify the cursor type.
Once installed, Toddy may be disabled with the /D switch and
enabled with the /E switch. These switches might be useful if an
application conflicts with Toddy. Toddy may also be removed from
memory with the uninstall switch (/U).
The end of this document contains a list of version changes and
some additional notes on using and configuring Toddy.
Editing
-------
Toddy's enhanced editing commands are available immediately upon
installation. When entering a DOS command, use the right and
left arrow keys to move the cursor non-destructively. Past
commands can be retrieved by pressing the up and down arrow keys,
or by typing a few letters and searching for a matching command
with the Tab key. You can quickly enter the name of an existing
file by typing part of the name and pressing F9 until the entire
name is displayed. The standard DOS editing keys may also be
used.
In the next table and throughout the rest of this document, a
"Ctrl-" to the immediate left of a keystroke or letter refers to
that keystroke being pressed while the CONTROL key is held down.
Similarly, an "Alt-" next to a keystroke refers to the keystroke
being pressed while the ALT key is held down. A complete list of
editing commands follows:
Left move cursor left
Right move cursor right
Home move cursor to first column
End move cursor to last column
Ctrl-Left move cursor to previous word
Ctrl-Right move cursor to next word
Delete delete character under the cursor
Backspace delete character to the left of the cursor
Ctrl-Backspace delete word to the left of the cursor
Ctrl-Home delete all characters left of the cursor
Ctrl-End delete all characters right of the cursor
Escape delete all characters on the line
Up load older history line
PgUp load oldest history line
Down load newer history line
PgDn load newest history line (last line saved)
Tab search for matching history line
Alt-F7 delete all history lines
F9 replace field with matching file name
F10 replace/append field with matching file name
Enter accept input
Ctrl-Enter accept input without any processing
Insert toggle insert mode
Ctrl-L delete word to the left of the cursor
Ctrl-R delete word to the right of the cursor
Ctrl-D delete current history line
Ctrl-K copy current line to history then clear line
Ctrl-V enter a control character
F1 copy next character from the template
F2 copy template characters up to the next key
F3 copy remaining characters from the template
F4 skip template characters up to the next key
F5 copy current input to the template
F6 insert EOF character
To enter control characters normally interpreted by DOS or Toddy,
press Ctrl-V and then the letter. For instance, press Ctrl-VC to
enter Ctrl-C. Toddy displays control characters using the actual
ASCII symbol, for instance a ^C (which is ASCII code 3) shows up
as a little heart. Besides the control keys listed above (Ctrl-
L, Ctrl-R, Ctrl-D, Ctrl-K, and Ctrl-V), some other codes that can
only be entered using Ctrl-V include: Ctrl-C (break), Ctrl-M
(enter), Ctrl-P (toggle line printer echo) and Ctrl-S (pause
display). Note that Toddy does not allow the NUL code (Ctrl-@)
to be entered.
File Name Completion
--------------------
The file name completion feature lets you quickly enter the name
of an existing file. Just type the first few letters of the file
name and press F9. The first file matching those letters will
replace the letters. Pressing F9 again will replace the first
matching file with the next matching file. If there are no more
matching files, pressing F9 does nothing. F10 works similarly to
F9, except matching files are appended to previous matches
(rather than replacing previous matches).
The initial search pattern may include wildcard characters and
may or may not include a file name extension. The /FT switch
determines the files types matched (i.e. normal, hidden, system,
and/or directories), and the /FU and /FL switches control whether
matching files are displayed in upper or lowercase letters. By
default, only normal files are matched and matching files are
displayed in uppercase.
Command History
---------------
Every time you execute a DOS command, the command is copied to
the command history for later retrieval. If there isn't enough
room because of previously saved commands, Toddy will delete the
oldest command or commands to make room. You can prevent a
command from being saved to the command history by pressing
Ctrl-Enter (instead of Enter) to run the command. You can copy a
command to the command history without running it by pressing F5
or Ctrl-K. The up arrow key will retrieve the last command.
Repeatedly pressing the up arrow key will retrieve progressively
older commands. The down arrow key retrieves newer commands (the
opposite of the up arrow key). Other keys for scrolling through
the command history are listed in the Editing section above.
Commands are not saved to the command history if they are identi-
cal to the last command. Also, Toddy can be configured to pre-
vent other types of commands from being saved. See the descrip-
tions of the /HM, /HU, and /HA switches in the Switch Descrip-
tions section. The command history may be written to a file or
loaded from a file with the /HW and /HR switches. The current
history can be locked, freed (unlocked), or cleared with the /HL,
/HF, and /HC switches. When the history is locked, commands are
no longer copied to it.
The command history can be searched by matching the beginning
characters. For instance, if you recently entered a long command
like:
tcc -v -ms zorro init.obj graflib.lib extra.lib
you can search for this line by typing the first few characters,
"tcc" for instance, and then pressing the Tab key. If there is
more than one saved command that begins with "tcc", repeatedly
pressing Tab will find each occurrence. If there are no more
occurrences, the display will not change.
When using the up or down arrow keys to scroll through the com-
mand history, Toddy will "wrap" from the oldest entry to the
newest, or from the newest to the oldest. Toddy loads a blank
line just before wrapping. If the history trace is enabled (the
default state) and you press the down arrow key before anything
else, Toddy will load the command from the history that follows
the last command selected from the history. See the description
of the /HT switch for more information.
Command History Window
----------------------
If you run Toddy without any command line arguments and Toddy has
already been installed, Toddy will display a window in the
center of the screen showing all the commands currently saved in
the command history. The Up and Down arrow keys scroll through
the list one line at a time, the Page-Up and Page-Down keys
scroll through the list a page at a time, and the Home and End
keys go to the first (oldest) and last (newest) commands.
When you've found a command you want run or edit, position the
command to the highlighted center of the window and press the
Enter key. The window will close and the command will be pre-
loaded to the input line.
The colors of the command window can be set with the /AB, /AH,
and /AX switches. Though Toddy automatically selects a size for
the window based on the current text mode, you can explicitly
select a size with the /SR and /SC switches.
Unlike other aspects of Toddy, the history window manipulates the
hardware directly and may not work on non-standard video systems.
Chained Commands
----------------
The chain character allows you to enter multiple commands on a
single line. The default chain character is Ctrl-T, but may be
changed with the /CC switch. If the chain character was defined
to be the caret (^), the command "arce files1^arce files2" will
run the two consecutive commands "arce files1" and "arce files2".
Any number of chained commands may be entered on a single line.
Macros (described later) can also contain chained commands.
Inside of macros and in the run command (/R), you can use $t to
chain commands together.
Press Ctrl-Break to cancel a sequence of executing chained com-
mands. Pressing Ctrl-Break may interrupt a sequence of chained
commands even if you are inside an application.
Macros
------
A macro is a user defined command that's automatically replaced
by a single command or multiple commands chained together.
Macros behave very much like small batch files. Some advantages
of macros over batch files are that macros are executed faster
(because they're stored in memory, not on disk), macros generally
use less disk space (because multiple macros can be stored in a
single file), macros can be defined or redefined on the fly, and
macros can have any name (for example you could have a macro
called DIR, but not a batch file). Some possible uses for macros
are renaming commands (like defining D to execute a DIR) and
applying default arguments to commands (for instance automatical-
ly applying the /W switch to all DIR commands). Macros will NOT
work in batch files. Macros are defined with the /MD and /ME
switches and cleared with the /MU, /MF, and /MC switches. Macros
can also be defined using the syntax:
TODDY macro=text
where "macro" is the name of the macro and all characters after
the equal sign are what the macro does. This second syntax for
defining macros is equivalent to the /ME switch. Similarly, a
macro can be undefined with the syntax:
TODDY macro=
You can also load and save macros to files with the /MR and /MW
switches. Use the /ML switch to list the currently defined
macros. Some simple macros might be:
TODDY d=dir
TODDY dir=dir /w
TODDY /md'clear'del *.obj $t del *.lst $t del *.map'
The first example above makes D act like a DIR command. The next
example automatically applies the /W switch to all DIR commands.
The last example creates a CLEAR command to delete all OBJ, LST,
and MAP files from the current directory. The first two examples
use one format for defining macros and the third example uses the
other format. The third example uses the special character
sequence "$t" to chain multiple commands together.
Macros can access command line arguments in the same way as batch
files. The first 99 arguments are retrieved using the parameters
$1 to $99. The special parameter $* returns all arguments start-
ing after the largest previously retrieved argument. For in-
stance, if you referred to $11 in your macro, a $* will return
all arguments starting with $12. Also, you can return all argu-
ments starting with a particular argument number using the syntax
$n*, where "n" is the starting argument number. For instance,
$7* will return all arguments starting with the seventh. The
character indicating a parameter, a dollar sign by default, can
be changed with the /CP switch; and the character for multiple
arguments, a asterisk by default, can be changed with the /CM
switch.
A more useful definition of the DIR macro above would use a
parameter as follows:
TODDY dir=dir $1 /w
With this macro definition, a DIR without arguments would expand
to "DIR /W", and a "DIR *.COM" would expand to "DIR *.COM /W".
Another example:
TODDY tcc=tcc -v $* userlib.lib
This macro replaces TCC with one that automatically specifies
multiple command line arguments. If you ran "tcc -O zipper",
you'd actually be running "tcc -v -O zipper userlib.lib".
There are other special parameters in addition to the $t used
above:
$$ replaced with parameter character ($)
$b replaced with bar (|)
$l replaced with less-than (<)
$g replaced with greater-than (>)
$q replaced with removable quote (see Quotes section)
$s parameter sink
The first five parameters above are simply replaced by the speci-
fied character. These parameters are necessary if you are creat-
ing a macro at the DOS prompt or in a batch file because Toddy
normally uses and absorbs the parameter and quote character, and
DOS normally uses and absorbs the bar, greater, and less-than
characters. The parameter sink works like the $* parameter
except an empty string is returned. The parameter sink is some-
times necessary because Toddy automatically appends unreferenced
trailing arguments, as if there was $* automatically appended all
macros. To suppress any trailing arguments, you must use the
parameter sink. See the two DIR macros below for an example of
using the $s parameter. All of the special parameters using a
letter can use an upper or lowercase letter.
Macros may be defined multiple times. The most recent definition
always takes precedence. A macro may also call another macro.
If a macro calls a macro of the same name, the most recent defi-
nition (prior to the calling macro) will be called. For in-
stance, if the following macros were defined:
TODDY dir=dir $* /w
TODDY dir=cls $s $t dir $*
a DIR command will call the second macro (because it's the most
recent definition). This macro clears the screen (with CLS) and
calls DIR. Since DIR has an earlier definition (the first
macro), it's also called as a macro. The net effect of running a
DIR command after defining the two macros above is to clear the
screen and perform a DOS DIR command with the /W switch. The
parameter sink ($s) is necessary in the second macro to prevent
any arguments from being appended to the CLS command.
If a command is preceded by the "literal character", it is not
interpreted as a macro. The literal character is undefined by
default, but can be defined with the /CL switch. If the literal
character was defined to be an exclamation mark, running "!DIR"
will execute the standard DOS directory command regardless of any
previous DIR macro definitions.
Toddy beeps, cancels all running macros, and returns an empty
input line if: 1. the macros are nested too deeply, 2. the macro
expansion is too long, or 3. the quote parameter ($q) or chain
parameter ($t) are used and no quote or chain character is de-
fined. The macro expansion may be too long internally (see the
/B switch) or too long for the command line (127 bytes for COM-
MAND.COM, and 255 bytes for 4DOS and NDOS). A potential macro
nest problem is circular macro references. For instance:
TODDY a=b
TODDY b=a
You will always get an error if you try to run one of these two
macros because these macros continuously call each other until
the macro nest level is exceeded.
Quotes
------
Macro arguments are defined as sequences of characters separated
by spaces, so there's no way retrieve an argument that contains
spaces unless you use quotes. All characters inside and includ-
ing double quotes (") are treated as a single argument. For
instance, if you defined the following macro:
TODDY g=grep $1 *.*
the following command will work properly because quotes are used:
g "a blank"
Toddy recognizes two kinds of quotes, text and removable. Text
quotes work as described above and removable quotes work similar-
ly but are removed when the line is evaluated. The default
removable quote is the back quote character (`). If you defined
the following macro:
TODDY e=echo ($1)
running:
e `a b c d`
will display:
(a b c d)
Chain characters are not evaluated inside of quoted arguments,
but parameters ($1, $2, $t, etc.) are. If you want to use the
parameter character inside of a quoted string, use the special
parameter $$.
The text and removable quote characters can be redefined with the
/CX and /CQ switches. You can also define a second text quote
character with the /CY switch.
Switches
--------
Switches take affect when Toddy is installed or can be passed to
an already resident Toddy by running Toddy again. Switches may
be written to the executable file TODDY.COM with the /W switch.
When switches are written to the executable file, they automati-
cally take effect when Toddy is installed. A list of the Toddy
command line switches are displayed to the screen by running:
TODDY /?
In the switch descriptions of the following sections, a "d" de-
notes a decimal digit, an "x" denotes a hexadecimal digit, and an
"'s'" denotes a string in quotes. The number of decimal or
hexadecimal digits only serve as a general reference to the
magnitude of the number -- in most cases fewer digits are al-
lowed.
Switch Summary
--------------
Installation:
/Bddddd input buffer size
/BSddd restricted input buffer size
/Mddd multiplex number
/Q quiet mode
/V verbose mode
/E enable Toddy
/D disable Toddy
/W write switches
/U uninstall Toddy
/UI uppercase ignored
/US uppercase significant
Attributes (colors):
/ATxx text attribute
/ACxx cursor attribute
/AExx end attribute
/ABxx command window border
/AHxx command window highlight
/AXxx command window text
Cursor Type:
/TC use custom cursor
/TS use system cursor
/TExxxx entry cursor type
/TIxxxx insert cursor type
/TOxxxx overwrite cursor type
/TXxxxx exit cursor type
Characters:
/CQddd quote character
/CXddd text quote character one
/CYddd text quote character two
/CPddd parameter character
/CMddd multiple argument character
/CLddd literal character
/CCddd chain character
Insert Mode:
/II select insert mode
/IO select overwrite mode
/IR reset insert
/IP preserve insert
File Name Completion:
/FL display names in lowercase letters
/FU display names in uppercase letters
/FTxx file name completion types
Command Window:
/S select command (open command window)
/SCddd command window columns
/SRddd command window rows
History:
/HSddddd command history size
/HMddd minimum command length
/HU save unique commands
/HA save all commands
/HL lock history
/HF free history
/HN no history trace
/HT history trace enabled
/HRfile read history from file
/HWfile write history to file
/HC clear history
Macros:
/MSddddd macro table size
/MNddd maximum macro nest
/MD's's' define macro
/ME's's' exchange (replace) macro
/MU's' undefine macro
/MF's' forget macro
/MC clear all macros
/ML list macros
/MR read macros from file
/MW write macros to file
Miscellaneous:
/A display memory allocations
/R's' run a command
Switch Descriptions
-------------------
/A Display memory allocations. The first three numbers
displayed are the memory allocated for the command
history, macro table, and file name completion. The
next three numbers are the total heap memory (usually
the sum of the first three numbers), the memory used by
macro definitions, and the amount of available heap
memory. The next two numbers are the maximum macro
nest and input buffer size. The last number is the
total bytes used by these data areas (the sum of the
first three numbers, the bytes used by the macro nest,
and the size of the input buffer). All available heap
memory can be used for macros. Whatever memory isn't
used by macros is used for the command history (or the
file name completion commands if needed). See the
Notes section for more information on memory usage.
/ABxx Set the attribute of the command history window border.
The /AC switch describes attribute bytes. The default
is /AB7.
/ACxx Set the attribute of the character under the cursor.
The first digit of the attribute byte is the background
color and the second digit is the foreground color.
Color values of 0 to 7 correspond to black, blue, green
cyan, red, magenta, brown, and white. Adding 8 to the
lower nibble makes the foreground color brighter.
Adding 8 to the upper nibble usually makes the fore-
ground blink. The default is /AC7 (white on black).
/AExx Set the attribute of the blanks following the text.
The /AC switch describes attribute bytes. The default
is /AE7.
/AHxx Set the attribute of the command history select line
(i.e. the "highlight" color). The /AC switch describes
attribute bytes. The default is /AH70.
/ATxx Set the attribute of the text. The /AC switch de-
scribes attribute bytes. The default is /AT7.
/AHxx Set the attribute of the command history text. The /AC
switch describes attribute bytes. The default is /AX7.
/Bddddd Set the input buffer size. This is the number of bytes
reserved for entering commands and expanding macros.
If there is an error running a macro, you may have to
make this number larger. The minimum value is 255 and
the default is /B512. If you don't use macros, or only
use short macros, you could conserve memory by reducing
this number to the minimum.
/BSddd Set the restricted input buffer size. If this switch
is used, Toddy will only process input when the speci-
fied number of characters are requested. To restrict
Toddy to DOS commands, use /BS128 for COMMAND.COM and
/BS255 for 4DOS and NDOS.
/CCddd Define the chain character. The chain character is
used to specify multiple commands on single line or in
a macro. The number is the ASCII value of the charac-
ter. The chain character cannot be a space. The
default is /CC20 (Ctrl-T). Chain characters are de-
scribed in the Chained Commands section.
/CLddd Define the literal character. A literal character
forces Toddy to pass a command directly to DOS without
interpreting it as a macro. The number is the ASCII
value of the character. The literal character cannot
be a space. The default is /CL0 (no literal character
defined). Literal characters are described in the
Macros section.
/CMddd Define the multiple argument character. The multiple
argument character is used with regular macro parame-
ters to refer to all following arguments. The number
is the ASCII value of the character. The multiple
argument character cannot be a space. The default is
/CM42 (an asterisk). Multiple argument parameters are
described in the Macros section.
/CPddd Define the parameter character. This is the character
used to specify parameters within macros. The number
is the ASCII value of the character. The parameter
character cannot be a space. The default is /CP36 (a
dollar sign). Macro parameters are described in the
Macros section.
/CQddd Define the removable quote character. This character
is primarily used to delimit macro parameters contain-
ing spaces or chain characters. The number is the
ASCII value of the character. The default is /CP96 (a
back quote). Quotes are described in the Quotes sec-
tion.
/CXddd Define the text quote character. This character delim-
its macro parameters containing spaces or chain charac-
ters. The number is the ASCII value of the character.
The default is /CP34 (a double quote). Quotes are
described in the Quotes section.
/CYddd Define the alternate text quote character. This char-
acter delimits macro parameters containing spaces or
chain characters. The number is the ASCII value of the
character. The default is /CP0 (undefined). Quotes
are described in the Quotes section.
/D Disable the resident Toddy. All command input will be
performed by DOS as if Toddy wasn't installed.
/E Enable the resident Toddy. This switch undoes the
effects of the disable switch, /D.
/FL Display file names in lowercase letters. This switch
makes file names inserted with the F9 or F10 keys
appear in lowercase letters.
/FTxx Select the file types for file name completion. This
switch allows you to specify what types of files will
be matched by the file name completion commands (F9 and
F10). The possible values are: 00 = normal file, 02 =
hidden files, 04 = system files, and 10 = directories.
Add the hexadecimal values together to combine types.
/FT10 (00 + 10) finds all normal files and directories.
/FT06 (00 + 02 + 04) finds all normal, hidden, and
system files. /FT16 (00 + 02 + 04 + 10) finds all files
and directories. The default is /FT00 (find normal
files only).
/FU Display file names in uppercase letters. This switch
makes file names inserted with the F9 or F10 keys
appear in uppercase letters. This is the default.
/HA Save all commands to the command history. This switch
undoes the effects of the /HU switch. This is the
default.
/HC Clear command history. All saved commands are deleted.
If you want to save a sequence of DOS commands as a
batch file (with the /HW switch), you could use this
switch to first clear any previously saved commands.
You can also clear the command history by pressing
Alt-F7.
/HF Free the command history. Commands will be saved to
the command history normally. This switch undoes the
effects of the /HL switch.
/HL Lock the command history. This switch prevents further
commands from being saved to the command history.
Unlock the history with the /HF switch.
/HMddd Set the minimum command length. All commands that are
shorter than this value are not saved to the command
history. This switch is useful if you don't want to
save trivial commands like DIR or CLS. The default is
/HM0 (all commands are saved).
/HN No history trace. This switch undoes the effects of
the /HT switch. The down arrow key always loads the
next newer command or wraps to the oldest command.
/HRfile Read the command history from a file. Each line of the
specified file is added to the command history. If the
command history is not large enough, older lines are
deleted to make room. The normal criteria for saving
commands (like minimum length) are not used. The file
may be created from scratch or be a previously saved
history. The file must a standard text file.
/HSddddd Set the command history size. The command history size
is the number of bytes reserved for saving commands.
If you don't use the command history, you can conserve
memory by setting the size to 0 with /HS0. The default
is /HS256.
/HT History trace enabled. When this switch is in effect,
if last command was selected from the command history,
the down arrow initially loads to the next newer com-
mand relative to the last command. This is useful for
reentering multiple commands. For instance, if you've
recently entered the commands:
COPY *.* A:
DEL *.*
and you want to run these two commands again, first
find the COPY command by entering "co" and pressing
TAB. When the COPY command is displayed, run it. Now
you can recall the DEL command just by pressing the
Down arrow key. This is the default.
/HU Save unique commands only. Toddy will scan the command
history and only save a command if it's different than
all the other saved commands. This switch is useful if
you primarily retrieve past commands by searching
rather than scrolling up or down the history. This
switch has the opposite effect of the /HA switch.
/HWfile Write the command history to a file. All commands
stored in the command history are written to the speci-
fied file. The commands are saved as a standard text
file. This switch can be used to run a sequence of DOS
commands and then save them as a batch file.
/II Select insert mode for editing. This is the default
mode.
/IO Select overwrite mode for editing.
/IP Preserve the insert/overwrite mode between commands.
The insert or overwrite mode is preserved from the last
time a command was entered. This switch has the oppo-
site effect of the /IR switch.
/IR Reset the insert/overwrite mode between commands. Each
time a command is entered, the mode will be set to
insert or overwrite (depending on the current mode when
this switch is used). This switch has the opposite
effect of the /IP switch. This is the default.
/Mddd Set the multiplex number. If you get the message
"Multiplex number in use by another program" when you
try to install Toddy, you can change the multiplex
number with the /M switch. The multiplex number should
be in the range 192 to 255. The default is /M215.
/MC Clear all macro definitions. This switch can be used
to delete all currently defined macros, or to ignore
any macros saved to TODDY.COM during installation.
/MD's's' Define a macro. This parameter uses two fields, the
macro name and the replacement text. The first charac-
ter after the /MD is the definition delimiter. Though
this delimiter is usually a quote (or double quote), it
can be any character not used in the macro or replace-
ment text. There are three delimiters: one at the
start of the macro name, one separating the macro name
from the replacement text, and one at the end of the
replacement text. The macro name can be any sequence
of characters, though it shouldn't contain any spaces.
The replacement text can contain any sequence of char-
acters. Note: this switch does not remove any previous
definitions of the macro. Use the /ME switch to re-
place the most recent definition of a macro. Macros
are described in the Macros section.
/ME's's' Exchange a macro. This switch replaces the most recent
definition of a macro, which is equivalent to undefin-
ing then defining a macro. The syntax and usage are
identical to the /MD switch.
/MF's' Forget a macro. This switch clears all definitions of
a macro (not just the most recent definition). The
macro name is delimited similarly to the macro defini-
tion switch (/MD), except there is no replacement text.
Use the /MU switch to clear only the most recent defi-
nition.
/ML List macros. All currently defined macros will be
displayed.
/MNddd Set maximum macro nest level. A nest level is used
whenever a macro calls another macro. If the maximum
nest level is reached while running a macro, Toddy will
beep and abort the macro. Toddy requires 4 bytes of
memory for each nest level. If you don't use macros,
you can conserve memory by setting the nest level to 0
with /MN0. The default is /MN10.
/MRfile Read macros from a file. The file must be a standard
text file. The file may be created by the user or by
saving macros with the /MW switch. Each line of the
file contains a single macro definition. The macros
must be defined in the form:
macro=text
where "macro" is the name of the macro and "text" is
the replacement text for the macro. All characters
after the first equals sign become part of the macro
text. Any line beginning with a colon is considered a
comment and is ignored.
/MSddddd Set the macro table size. The macro table size is the
number of bytes reserved for macro definitions. If you
don't use macros, you can conserve memory by setting
the table size to 0 with /MS0. The default is /MS256.
/MU's' Undefine a macro. This switch clears the most recent
definition of a macro. The macro name is delimited
similarly to the macro definition switch (/MD), except
there is no replacement text. Note that a macro may
have multiple definitions and this switch only clears
the most recent. Use the /MF switch to clear all
definitions of a macro.
/MWfile Write macros to a file. All currently defined macros
are written to the specified file. The file is a
standard text file with one macro definition per line.
Macros saved with this switch can be loaded with the
/MR switch.
/Q Enable quiet mode. When Toddy is in quiet mode, the
regular confirmation messages are suppressed -- only
error messages are displayed. If you use /Q before all
other switches on the command line, Toddy's banner will
also be suppressed.
/R's' Run a command. The specified command is preloaded to
the input buffer, and the next time Toddy gets the
chance, the command will be executed. If this switch
is used in batch file, the command will be run as soon
as the batch file terminates. The command is delimited
similarly to the macro definition switch (/MD), except
there is no replacement text.
/S Select a previous command. This switch opens the
command history window and lets you select a past
command by scrolling through the command history. Once
Toddy has been installed, running Toddy without any
command line arguments also performs this function.
See the Command History Window section for more infor-
mation.
/SCddd Set the number of columns used by the command history
window. This the number includes the border. The
default is /SC0, which tells Toddy to decide how many
columns.
/SRddd Set the number of rows used by the command history
window. This number includes the border. The default
is /SR0, which tells Toddy to decide how many rows.
/TC Use the custom cursor type defined with the /TE, /TI,
and /TO switches. The /TE, /TI, and /TO switches
automatically set this switch.
/TExxxx Set the entry cursor type. This switch sets both the
insert and overwrite cursor types. This switch should
be used instead of, but not with, the /TI and /TO
switches. The cursor type is the size and shape of the
blinking cursor blob. The first byte of this two byte
value is the top scan line number and the second byte
is the bottom scan line number. The scan lines for CGA
are numbered 00 to 07, for EGA adapters it's 00 to 0D,
and for VGA adapters it's 00 to 0E. The default cursor
is usually the bottom two scan lines (i.e. 0607 for
CGA, 0C0D for EGA, and 0D0E for VGA). You can make a
big blinking blob on most adapters with 000F. You can
turn off the blinking cursor entirely on most adapters
with value of 2000.
/TIxxxx Set the insert cursor type. This is the cursor type
used when in insert mode. The /TE switch describes how
to set the cursor type.
/TOxxxx Set the overwrite cursor type. This is the cursor type
used when in overwrite mode. The /TE switch describes
how to set the cursor type.
/TS Use system cursor (i.e. don't make any changes to it).
This switch turns off all the custom cursor settings.
This is the default.
/TXxxxx Set exit cursor type. This is the cursor type to use
when Toddy has finished inputting a line. Generally,
this switch is used to restore the cursor after setting
it with the other cursor switches. For this and the
other cursor switches, if no cursor is specified, the
current system cursor will be used (i.e. this switch
usually isn't necessary).
/U Uninstall Toddy. This switch removes Toddy from memo-
ry. It may not be possible to uninstall Toddy if
another TSR has been loaded after Toddy.
/UI Uppercase letters are ignored. This switch undoes the
effects of the /UI switch and is the default state.
/US Uppercase letters are significant. If this switch is
specified, Toddy will treat uppercase and lowercase
letters as being different. For instance, if you
define a macro called "DIR" and ran the command "dir",
the macro will NOT be run. This switch also affects
command history operations, like searches and saving
unique commands (the /HU switch). Note that DOS is NOT
case-sensitive -- this switch only affects Toddy.
/V Enable verbose mode. This switch undoes the effects of
the /Q switch.
/W Write current settings to TODDY.COM. All switches and
macros will be written the executable file TODDY.COM.
The settings will be the new defaults the next time
Toddy is installed. A macro definition may be removed
from TODDY.COM by undefining the macro and rewriting
the settings. If you are running DOS 2.X, TODDY.COM
must be in the current directory when using this
switch.
Examples
--------
TODDY
Install Toddy using the default switches.
TODDY /hs10000 /ms100 /to000f
Install Toddy with a 10000 byte command history, 100 byte macro
area, and set the cursor scan lines to a big blinking blob
whenever overwrite mode is in effect.
TODDY /at1F /ac4F /ae1F /te2000
Set the colors to a uniform bright white on blue with a red
block cursor. The blinking cursor is turned off for each
input.
TODDY /hs1000 /hm6 /w
Write the /HS1000 and /HM6 switches to TODDY.COM so they don't
need to be specified the next time Toddy is installed.
TODDY /md'dir'dir $* /w' /md'del'move $1 c:\trashcan' /cl33
Define two macros and set the literal character to an exclama-
tion mark. The first macro appends the /W parameter to all DIR
commands. The second macro makes the DEL command move files to
be deleted to a directory called TRASHCAN, where they can be
later retrieved if you change your mind about the deletion.
With the definition of the literal character, !DEL performs a
regular and permanent delete. The DEL macro requires a MOVE
utility, which isn't usually included with DOS, but is avail-
able on many BBS's and online services.
TODDY /u
Remove Toddy from memory.
Version Changes
---------------
Version 2.00
First public release.
Version 2.01
Several command line switches renamed.
Version 2.10
Ctrl-Break implemented and mouse support removed to conserve
memory.
Version 2.11
Search command made case-insensitive.
Version 2.20
Cursor switches expanded.
Version 3.00
Complete rewrite. New features include chained commands and
macros. Other changes include: most command line switches
renamed, switches are automatically passed to a resident Toddy
(no /RS needed), default values changed, several editing keys
changed, delimiters for move word left and right changed, and
history search improved.
Version 4.00
Many new features added: macros and the command history may be
saved and loaded from a file, control characters can be en-
tered, Ctrl-Break cancels chained commands and macros, DOS
editing keys supported, file name completion, and more. Other
changes include: several editing keys changed, alternate syntax
for defining macros, switches must start with a slash (/),
macro parameter syntax slightly changed.
Version 5.00
Macro interpreter totally rewritten: previous restrictions with
regard to the $* parameter have been removed, parameters above
$9 are now $10 to $99, new special parameters introduced ($t,
$l, $g, etc), $n* parameter added, trailing arguments automati-
cally appended to macro expansion, the asterisk in the $* and
$n* parameters can be redefined. New features added: quoted
strings, command history window, comments in macro files,
preload a command to the input buffer (/R switch), and the /FL,
/FU, /HT, /HN switches. Other changes include: down arrow key
has new function (see /HT and /HN switches), macro definition
syntax "macro=text" and "macro=" replace and undefine macro
definitions, /Q affects banner without writing to file, new
memory configuration option /B, and suppresses system prompt
for phantom drives.
Version 5.01
Fixed a bug associated with the /TE /TI /TO /TX switches.
Version 5.10
Cursor is moved to the end of the line when loading commands
from the command history, the cursor isn't hidden in the selec-
tion window, and the allocation switch (/A) displays more
information.
Version 5.11
Fixed "Error in switches ..." message when using /S switch.
Notes
-----
Toddy performs the same function as the DOSKEY utility provided
with DOS version 5. The two programs are somewhat macro and
keystroke compatible, though the command line switches are total-
ly different. By and large, Toddy has a lot more features than
DOSKEY but uses a little more memory (in its default configura-
tion).
Toddy will work with 4DOS (and the version of 4DOS licensed to
Symantec/Peter Norton Computing called NDOS), though the /L1
parameter must be set using the SETDOS command. When Toddy is
installed under 4DOS, many of 4DOS' features are still available,
including aliases and multiple commands on a single line. Toddy
is somewhat redundant when using 4DOS, since most of the features
of Toddy are available through 4DOS. If you use Toddy's /BS
switch, the setting for 4DOS must be /BS255.
You may have some trouble using redirected input with programs
like DEBUG and EDLIN when Toddy is installed. If Toddy receives
a redirected text file, Toddy will interpret both the carriage
return and linefeed, which are at the end of every text line, as
the ENTER key. If effect, you'll get two ENTER's after every
line. To fix this problem, temporarily disable Toddy or use the
/BS switch to limit when Toddy is active. Redirected input is
frequently used to assemble small programs using the DEBUG pro-
gram.
The memory allocated with the /HS and /MS switches is assigned to
a common pool called the heap. If you allocate memory to the
command history but no memory to the macro table, you will still
be able to define macros, though this will leave you with less
than the allocated amount of history space. The /A switch dis-
plays the current memory allocations. All available heap memory
may be used for macros, and whatever memory is left over is used
for the command history. The third number displayed by the /A
switch is the heap memory required by the file name completion
commands (F9 and F10). There must be at least that many bytes
free to use these commands. When the file name completion com-
mands are used, the size of command history may adjusted downward
by deleting the oldest entries.
The DOS template commands (F1 to F4) use the most recent command
line stored in the command history, so if you plan on using these
keys, you should make sure that there is enough history space
(i.e. enough free space) to hold at least one command line.
Before Toddy is installed, all available memory is allocated to
the memory pool. If you run "TODDY /A" before installing Toddy,
the total allocated memory will usually be larger than the sum of
the first three numbers. This number is the approximate number
of maximum bytes available for the /B, /HS, /MS, and /MN switch-
es.
Each command of a chained command is displayed as it is executed.
Only the final form of the command is displayed (that is, after
all macros have been processed). To see the see final form of
the first command, precede the chained commands with the chain
character. For instance, if you defined the following macro:
TODDY d=dir
when you run the "d" macro, you will not see the DIR command,
just the results of the DIR. If you wish to see the actual DIR,
define the macro as:
TODDY d=$s$tdir
You might have trouble using the DOS pipe and redirection com-
mands with macros because the macro parameters $* and $n* will
include such commands. So if you define the following macro:
TODDY d=dir $* /w
if you run D and try to redirect the output "d > file" the macro
will expand to "dir > file /w", which probably isn't what you
want. With most programs, you can solve this problem by specify-
ing the command line switches first, so define the macro as:
TODDY d=dir /w $*
You can use the parameter character (the dollar sign by default)
in macro names, but if you call that macro from another macro,
you must use two parameter characters ($$). You can also use the
chain character in macro names, but you must put the macro name
in (removable) quotes to call it. Macro names cannot contain
spaces or removable quotes. If you use a quote before or within
the first field of a line, the quotes only affect the first field
(i.e. the command), not the arguments.
If you have saved macros to TODDY.COM (using the /W switch), use
the /MC switch to install Toddy without those macro definitions.
It will be necessary use the /MC switch to install Toddy with a
macro and history size of zero if you have saved macros in this
manner.